﻿using sql_data_generator.Enums;
using System;

namespace sql_data_generator.FieldOptions
{
    static class FieldOptionsFactory
    {
        /*
        public static IFieldOptions GetFieldOptions(SubFieldType subFieldType)
        {
            string typeName = string.Format("sql_data_generator.FieldOptions.FieldOptions{0}", subFieldType);
            var type = Type.GetType(typeName);

            return type != null ? (IFieldOptions)Activator.CreateInstance(type) : null;
        }*/

        public static BaseFieldOptions GetFieldOptions(SubFieldType subFieldType)
        {
            string typeName = string.Format("sql_data_generator.FieldOptions.FieldOptions{0}", subFieldType);
            var type = Type.GetType(typeName);

            return type != null ? (BaseFieldOptions)Activator.CreateInstance(type) : null;
        }
    }
}